<!DOCTYPE html>
<html  lang="zh-CN" >
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
    content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <meta name="theme-color" content="#fff" id="theme-color">
  <meta name="description" content="深山磨柴斧，一鸣震江湖">
  <link rel="icon" href="/img/ic_head.jpg">
  <title>AutoJS一文精通AutoJS脚本教程详解</title>
  
  
  <meta property="og:title" content="AutoJS一文精通AutoJS脚本教程详解">
  
  
  <meta property="og:url" content="http://example.com/2021/02/16/AutoJS%E4%B8%80%E6%96%87%E7%B2%BE%E9%80%9AAutoJS%E8%84%9A%E6%9C%AC%E6%95%99%E7%A8%8B%E8%AF%A6%E8%A7%A3/index.html">
  
  
  <meta property="og:img" content="/img/ic_head.jpg">
  
  
  <meta property="og:img" content="深山磨柴斧，一鸣震江湖">
  
  
  <meta property="og:type" content="article">
  <meta property="og:article:published_time" content="2021-02-16">
  <meta property="og:article:modified_time" content="2021-04-16">
  <meta property="og:article:author" content="Cupster">
  
  
  <meta property="og:article:tag" content="AutoJS">
  
  <meta property="og:article:tag" content="自动化脚本">
  
  
  
  
  <script>
    // control reverse button
    var reverseDarkList = {
      dark: 'light',
      light: 'dark'
    };
    var themeColor = {
      dark: '#1c1c1e',
      light: '#fff'
    }
    // get the data of css prefers-color-scheme
    var getCssMediaQuery = function() {
      return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
    };
    // reverse current darkmode setting function
    var reverseDarkModeSetting = function() {
      var setting = localStorage.getItem('user-color-scheme');
      if(reverseDarkList[setting]) {
        setting = reverseDarkList[setting];
      } else if(setting === null) {
        setting = reverseDarkList[getCssMediaQuery()];
      } else {
        return;
      }
      localStorage.setItem('user-color-scheme', setting);
      return setting;
    };
    // apply current darkmode setting
    var setDarkmode = function(mode) {
      var setting = mode || localStorage.getItem('user-color-scheme');
      if(setting === getCssMediaQuery()) {
        document.documentElement.removeAttribute('data-user-color-scheme');
        localStorage.removeItem('user-color-scheme');
        document.getElementById('theme-color').content = themeColor[setting];
      } else if(reverseDarkList[setting]) {
        document.documentElement.setAttribute('data-user-color-scheme', setting);
        document.getElementById('theme-color').content = themeColor[setting];
      } else {
        document.documentElement.removeAttribute('data-user-color-scheme');
        localStorage.removeItem('user-color-scheme');
        document.getElementById('theme-color').content = themeColor[getCssMediaQuery()];
      }
    };
    setDarkmode();
  </script>
  <script>
    function loadScript(url, cb) {
      var script = document.createElement('script');
      script.src = url;
      if (cb) script.onload = cb;
      script.async = true;
      document.body.appendChild(script);
    }
  </script>
  
  <link rel="preload" href="//at.alicdn.com/t/font_1946621_i1kgafibvw.css" as="style" >
  <link rel="preload" href="//at.alicdn.com/t/font_1952792_89b4ac4k4up.css" as="style" >
  
  <link rel="preload" href="/js/lib/lightbox/baguetteBox.min.js" as="script">
  <link rel="preload" href="/js/lib/lightbox/baguetteBox.min.css" as="style" >
  
  
  <link rel="preload" href="/js/lib/lozad.min.js" as="script">
  
  
  
  
  
  
  
  
<link rel="stylesheet" href="/css/main.css">

  
  
<link rel="stylesheet" href="//at.alicdn.com/t/font_1946621_i1kgafibvw.css">

  
  
<link rel="stylesheet" href="//at.alicdn.com/t/font_1952792_89b4ac4k4up.css">

  
  
<link rel="stylesheet" href="/js/lib/lightbox/baguetteBox.min.css">

  
  
  
  
<meta name="generator" content="Hexo 5.4.0"></head>


<body>
  <div class="wrapper">
    
    <nav class="navbar">
  <div class="navbar-logo">
    <span class="navbar-logo-main">
      
      <img class="navbar-logo-img" src="/img/ic_head.jpg" alt="logo">
      
      <span class="navbar-logo-dsc">不负明天</span>
    </span>
  </div>
  <div class="navbar-menu">
    
    <a href="/" class="navbar-menu-item">
    
    首页
    
    </a>
    
    <a href="/archives" class="navbar-menu-item">
    
    归档
    
    </a>
    
    <a href="/tags" class="navbar-menu-item">
    
    标签
    
    </a>
    
    <a href="/categories" class="navbar-menu-item">
    
    分类
    
    </a>
    
    <a href="/about" class="navbar-menu-item">
    
    关于
    
    </a>
    
    <a href="/links" class="navbar-menu-item">
    
    友链
    
    </a>
    
    <a class="navbar-menu-item darknavbar" id="dark"><i class="iconfont icon-weather"></i></a>
    <a class="navbar-menu-item searchnavbar" id="search"><i class="iconfont icon-search" style="font-size: 1.2rem; font-weight: 400;"></i></a>
  </div>
</nav>
    
    <div id="local-search" style="display: none;">
      <input class="navbar-menu-item" id="search-input" placeholder="请输入搜索内容...">
      <div id="search-content"></div>
    </div>
    
    <div class="section-wrap">
      <div class="container">
        <div class="columns">
          <main class="main-column">
<article class="card card-content">
  <header>
    <h1 class="post-title">
      AutoJS一文精通AutoJS脚本教程详解
    </h1>
  </header>
  <div class="post-meta post-show-meta">
    <time datetime="2021-02-16T04:50:36.000Z">
      <i class="iconfont icon-calendar" style="margin-right: 2px;"></i>
      <span>2021-02-16</span>
    </time>
    
    <span class="dot"></span>
    
    <a href="/categories/自动化脚本/" class="post-meta-link">自动化脚本</a>
    
    
    
    <span class="dot"></span>
    <span>1.3k 字</span>
    
  </div>
  
  <div class="post-meta post-show-meta" style="margin-top: -10px;">
    <div style="display: flex; align-items: center;">
      <i class="iconfont icon-biaoqian" style="margin-right: 2px; font-size: 1.15rem;"></i>
      
      
        <a href="/tags/AutoJS/" class="post-meta-link">AutoJS</a>
      
      
      <span class="dot"></span>
      
        <a href="/tags/自动化脚本/" class="post-meta-link">自动化脚本</a>
      
    </div>
  </div>
  
  </header>
  <div id="section" class="post-content">
    <p>本文基于读者熟悉或了解JavaScript</p>
<hr/>

<h1 id="1-基础"><a href="#1-基础" class="headerlink" title="1.基础"></a>1.基础</h1><ul>
<li>屏幕坐标系，屏幕左上角为原点（0，0），向右为x轴正向，向下为y轴正向</li>
<li>单位为px</li>
<li>其他大部语法与JS相似或一致</li>
</ul>
<h1 id="2-常用api"><a href="#2-常用api" class="headerlink" title="2.常用api"></a>2.常用api</h1><table>
<thead>
<tr>
<th>函数</th>
<th>功能</th>
</tr>
</thead>
<tbody><tr>
<td>click(x,y)</td>
<td>click(500,500) 点击屏幕x=500px，y=500px的点</td>
</tr>
<tr>
<td>press(x,y,mills)</td>
<td>press(200,200，1000) 按住（200，200）1秒钟</td>
</tr>
<tr>
<td>sleep(mills)</td>
<td>sleep(1000) 程序暂停1秒</td>
</tr>
<tr>
<td>press(x,y,1);<br/>sleep(50);<br/>press(x,y,1)</td>
<td>双击</td>
</tr>
<tr>
<td>swipe(x1,x2,y1,y2,t)</td>
<td>swipe(100,300,600,900,1000);<br/>从A点（100，300）滑动到B点（600，900）耗时设置1秒</td>
</tr>
<tr>
<td>auto.waitFor()</td>
<td>等待申请无障碍权限，一般用于脚本开头</td>
</tr>
<tr>
<td>Tap(x,y)</td>
<td>与click(x,y)一样，Android7.0以下使用，且需要root</td>
</tr>
<tr>
<td>Swipe(x1,x2,y1,y2,t)</td>
<td>与swipe(x1,y1,x2,y2,t)一样，Android7.0以下使用，且需要root</td>
</tr>
<tr>
<td>console.verbose</td>
<td>灰色日志</td>
</tr>
<tr>
<td>console.info</td>
<td>绿色日志</td>
</tr>
<tr>
<td>console.warn</td>
<td>蓝色日志</td>
</tr>
<tr>
<td>console.error</td>
<td>红色日志</td>
</tr>
<tr>
<td>toast（str）</td>
<td>气泡提示 ，str为内容</td>
</tr>
<tr>
<td>serScreenMetrics(width,height)</td>
<td>设置脚本运行屏幕的宽高<br/>宽不一致，会自动缩放运行的坐标值</td>
</tr>
<tr>
<td>var w = device.height</td>
<td>获取屏幕高度px</td>
</tr>
<tr>
<td>var w = device.width</td>
<td>获取屏幕宽度px</td>
</tr>
<tr>
<td>console.show();</td>
<td>显示控制台</td>
</tr>
<tr>
<td>console.hide();</td>
<td>隐藏控制台</td>
</tr>
<tr>
<td>console.rawInput();</td>
<td>等待控制台输入内容、并等待点击确定</td>
</tr>
<tr>
<td>dialog.confirm(title ,content)</td>
<td>弹出确认框，点击确定返回true，点击取消返回false</td>
</tr>
<tr>
<td>engines.execScriptFile(path)</td>
<td>启动path对应的脚本<br/>可用相对路径：./xx.js同目录的脚本</td>
</tr>
<tr>
<td>engines.stopAll()</td>
<td>停止所有脚本，包括自身</td>
</tr>
<tr>
<td>exit()</td>
<td>停止当前脚本</td>
</tr>
<tr>
<td>app.launchApp(appName)</td>
<td>通过APP名启动app</td>
</tr>
<tr>
<td>app.launchApp(pkgName)</td>
<td>通过包名启动app</td>
</tr>
<tr>
<td>app.uninstall(pkgName)</td>
<td>通过包名卸载app</td>
</tr>
<tr>
<td>app.openUrl(url)</td>
<td>打开浏览器，并打开指定url</td>
</tr>
<tr>
<td>back()</td>
<td>返回键功能</td>
</tr>
<tr>
<td>home()</td>
<td>home键功能</td>
</tr>
<tr>
<td>random(min ,max)</td>
<td>返回随机数[min ，max]</td>
</tr>
<tr>
<td>toastLog(message)</td>
<td>toast(str)和log(str)的合并</td>
</tr>
<tr>
<td>device.vibrate(mills)</td>
<td>device.vibrate(1000)手机震动1秒</td>
</tr>
<tr>
<td>device.keepScreenOn(mill)</td>
<td>让手机保持常亮，不设置时间则为常亮，设置时间，即为指定常亮时间</td>
</tr>
<tr>
<td>setClip(text)</td>
<td>设置剪贴板内容</td>
</tr>
<tr>
<td>getClip()</td>
<td>获取粘贴板的内容</td>
</tr>
<tr>
<td>setInterval（function(){} , mills）</td>
<td>设置指定间隔时间，的循环体</td>
</tr>
</tbody></table>
<h1 id="3-原生控件有关api"><a href="#3-原生控件有关api" class="headerlink" title="3.原生控件有关api"></a>3.原生控件有关api</h1><p>在auto.js软件中有直接获取到控件信息的功能，在auto.js软件主页面，点击右上角，打开侧拉菜单，大致中间位置的悬浮窗打开。这个auto.js的悬浮窗就含有获取控件信息的功能。点击悬浮窗我们可以看到有5个功能，中间蓝色的就是用于查看控件信息的功能，点击之后，会让你选择用布局范围分析和布局层次分析</p>
<p>比较主要的控件信息有id即控件的id属性，text控件的文本属性，bounds控件的边框位置，desc控件的desc值，有些控件会把text控件放空，并把上面的文本写入desc值。clickable/longClickable控件是否可以点击/长按，如果控件的clickable为false那么点击也没用。checked控件是否选中，depth在第几层次，indexInParent在父控件中是第几个.</p>
<table>
<thead>
<tr>
<th>api</th>
<th>功能</th>
</tr>
</thead>
<tbody><tr>
<td>id(“a”).text(“abc”).findOne().click();</td>
<td>选择id属性为a的，text属性为abc的控件，直到找到一个符合以上条件的控件，对其点击。</td>
</tr>
<tr>
<td>desc()</td>
<td>匹配desc值为传参的控件</td>
</tr>
<tr>
<td>descContains(“cd”)</td>
<td></td>
</tr>
<tr>
<td>descStartsWith()</td>
<td></td>
</tr>
<tr>
<td>descEndsWith()</td>
<td></td>
</tr>
<tr>
<td>descMatches（）</td>
<td>用于传入正则表达式 匹配查找对应的控件</td>
</tr>
<tr>
<td>text()</td>
<td></td>
</tr>
<tr>
<td>textContains()</td>
<td></td>
</tr>
<tr>
<td>textStartsWith()</td>
<td></td>
</tr>
<tr>
<td>textEndsWith()</td>
<td></td>
</tr>
<tr>
<td>textMatches()</td>
<td></td>
</tr>
<tr>
<td>id()</td>
<td></td>
</tr>
<tr>
<td>idContains()</td>
<td></td>
</tr>
<tr>
<td>idStartsWith()</td>
<td></td>
</tr>
<tr>
<td>idEndsWith()</td>
<td></td>
</tr>
<tr>
<td>idMatches()</td>
<td></td>
</tr>
<tr>
<td>className</td>
<td></td>
</tr>
<tr>
<td>package</td>
<td></td>
</tr>
<tr>
<td>clickable(true)</td>
<td>可点击选择器</td>
</tr>
<tr>
<td>checkable()</td>
<td>是否可勾选</td>
</tr>
<tr>
<td>selected()</td>
<td>是否已选中</td>
</tr>
<tr>
<td>longClickable()</td>
<td>是否可长按</td>
</tr>
<tr>
<td>enabled()</td>
<td>控件是否已启用 - 选择器</td>
</tr>
<tr>
<td>scrollable()</td>
<td>选择器：控件是否可滑动</td>
</tr>
<tr>
<td>editable()</td>
<td>选择器：控件是否可编辑</td>
</tr>
<tr>
<td>-</td>
<td>-</td>
</tr>
<tr>
<td>bounds(x1,y1,x2,y2)</td>
<td>控件位置范围 ，四个整数值组成前两个值为控件长方形左上角的坐标，后两个值是控件右下角点的坐标</td>
</tr>
<tr>
<td>boundsInside(x1,y1,x2,y2)</td>
<td>boundsInside(233,233,666,666)</td>
</tr>
<tr>
<td>filter(function(w){return w.text().length==10})</td>
<td>过滤出text属性有10个字符的控件</td>
</tr>
<tr>
<td>findOne()</td>
<td>寻找屏幕上符合前面控件选择器的函数，直到出现，并返回第一个出现的控件，另外他还可以传入一个参数—最大查找时间，即位，如果到了时间还没有找到的话，直接返回undifined，以继续脚本</td>
</tr>
<tr>
<td>findOnce()</td>
<td>函数只会寻找一次，如果当前屏幕上没有，则直接返回null，他也可以传入一个参数，用于写，需要获取当前屏幕上第几个符合条件的内容，如果当前屏幕上的个数，不够获取的个数，则返回null</td>
</tr>
<tr>
<td>untilFind()</td>
<td>他会循环寻找，至少要找到一个才会返回合集</td>
</tr>
<tr>
<td>find()</td>
<td>选择器转换成合集</td>
</tr>
</tbody></table>
<h1 id="4-控件"><a href="#4-控件" class="headerlink" title="4.控件"></a>4.控件</h1><table>
<thead>
<tr>
<th>api</th>
<th>功能</th>
</tr>
</thead>
<tbody><tr>
<td>setText()</td>
<td>输入框内内容：id(“edit”).findOne().setText(“123456”);</td>
</tr>
<tr>
<td>控件.parent()</td>
<td>获得到这个函数的父控件函数</td>
</tr>
<tr>
<td>child(第几个)</td>
<td>获取到他的第几个子控件，注意序号从零开</td>
</tr>
<tr>
<td>children()</td>
<td>用于返回这个控件的所有子控件</td>
</tr>
<tr>
<td>findByText(str)</td>
<td>需要传入一段文&lt;字符串&gt;，这个函数返回他所有子控件或者孙控件中text或者desc属性中包含这段文字的所有控件</td>
</tr>
</tbody></table>

  </div>
  <div>
  
  <div class="post-note note-warning copyright" style="margin-top: 42px">
    <p><span style="font-weight: bold;">作者：</span><a target="_blank" rel="nofollow noopener noreferrer" href="http://example.com/about">Cupster</a></p>
    <p><span style="font-weight: bold;">文章链接：</span><a target="_blank" rel="nofollow noopener noreferrer" href="http://example.com/2021/02/16/AutoJS%E4%B8%80%E6%96%87%E7%B2%BE%E9%80%9AAutoJS%E8%84%9A%E6%9C%AC%E6%95%99%E7%A8%8B%E8%AF%A6%E8%A7%A3/">http://example.com/2021/02/16/AutoJS%E4%B8%80%E6%96%87%E7%B2%BE%E9%80%9AAutoJS%E8%84%9A%E6%9C%AC%E6%95%99%E7%A8%8B%E8%AF%A6%E8%A7%A3/</a></p>
    <p><span style="font-weight: bold;">版权声明：</span>本博客所有文章除特别声明外，均采用<a target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA 4.0 协议</a>。转载请注明出处！</p>
  </div>
  
  </div>
</article>
<div class="nav">
  
  <div class="nav-item-prev">
    <a href="/2021/03/02/Git commit规范/" class="nav-link">
      <i class="iconfont icon-left nav-prev-icon"></i>
      <div>
        <div class="nav-label">上一篇</div>
        
        <div class="nav-title">Git commit规范 </div>
        
      </div>
    </a>
  </div>
  
  
  <div class="nav-item-next">
    <a href="/2021/01/21/架构师进阶：注解Annotation全解/" class="nav-link">
      <div>
        <div class="nav-label">下一篇</div>
        
        <div class="nav-title">架构师进阶：注解Annotation全解 </div>
        
      </div>
      <i class="iconfont icon-right nav-next-icon"></i>
    </a>
  </div>
  
</div>

<div class="card card-content toc-card" id="mobiletoc">
  <div class="toc-header"><i class="iconfont icon-menu" style="padding-right: 2px;"></i>目录</div>
<ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#1-%E5%9F%BA%E7%A1%80"><span class="toc-text">1.基础</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#2-%E5%B8%B8%E7%94%A8api"><span class="toc-text">2.常用api</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#3-%E5%8E%9F%E7%94%9F%E6%8E%A7%E4%BB%B6%E6%9C%89%E5%85%B3api"><span class="toc-text">3.原生控件有关api</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#4-%E6%8E%A7%E4%BB%B6"><span class="toc-text">4.控件</span></a></li></ol>
</div></main>
          <aside class="left-column">
            
            <div class="card card-author">
              
<img src="/img/ic_head.jpg" class="author-img">

<p class="author-name">Cupster</p>
<p class="author-description">深山磨柴斧，一鸣震江湖</p>
<div class="author-message">
  <a class="author-posts-count" href="/archives">
    <span>66</span>
    <span>文章</span>
  </a>
  <a class="author-categories-count" href="/categories">
    <span>5</span>
    <span>分类</span>
  </a>
  <a class="author-tags-count" href="/tags">
    <span>31</span>
    <span>标签</span>
  </a>
</div>

<div class="author-card-society">
  
    <div class="author-card-society-icon">
      <a target="_blank" rel="noopener" href="https://cupster.blog.csdn.net/">
        <i class="iconfont /img/ic_csdn.png society-icon"></i>
      </a>
    </div>
  
</div>

            </div>
            
            <div class="sticky-tablet">
  
  
  <article class="display-when-two-columns spacer">
    <div class="card card-content toc-card">
      <div class="toc-header"><i class="iconfont icon-menu" style="padding-right: 2px;"></i>目录</div>
<ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#1-%E5%9F%BA%E7%A1%80"><span class="toc-text">1.基础</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#2-%E5%B8%B8%E7%94%A8api"><span class="toc-text">2.常用api</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#3-%E5%8E%9F%E7%94%9F%E6%8E%A7%E4%BB%B6%E6%9C%89%E5%85%B3api"><span class="toc-text">3.原生控件有关api</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#4-%E6%8E%A7%E4%BB%B6"><span class="toc-text">4.控件</span></a></li></ol>
    </div>
  </article>
  
  
  <article class="card card-content categories-widget">
    <div class="categories-card">
  <div class="categories-header"><i class="iconfont icon-fenlei" style="padding-right: 2px;"></i>分类</div>
  <div class="categories-list">
    
      <a href="/categories/Android/">
        <div class="categories-list-item">
          Android
          <span class="categories-list-item-badge">38</span>
        </div>
      </a>
    
      <a href="/categories/Linux/">
        <div class="categories-list-item">
          Linux
          <span class="categories-list-item-badge">6</span>
        </div>
      </a>
    
      <a href="/categories/Dev-Base/">
        <div class="categories-list-item">
          Dev-Base
          <span class="categories-list-item-badge">12</span>
        </div>
      </a>
    
      <a href="/categories/Kotlin/">
        <div class="categories-list-item">
          Kotlin
          <span class="categories-list-item-badge">9</span>
        </div>
      </a>
    
      <a href="/categories/自动化脚本/">
        <div class="categories-list-item">
          自动化脚本
          <span class="categories-list-item-badge">1</span>
        </div>
      </a>
    
  </div>
</div>
  </article>
  
  <article class="card card-content tags-widget">
    <div class="tags-card">
  <div class="tags-header"><i class="iconfont icon-biaoqian" style="padding-right: 2px;"></i>热门标签</div>
  <div class="tags-list">
    
    <a href="/tags/Android/" title="Android"><div class="tags-list-item">Android</div></a>
    
    <a href="/tags/Android自定义View/" title="Android自定义View"><div class="tags-list-item">Android自定义View</div></a>
    
    <a href="/tags/MacOS/" title="MacOS"><div class="tags-list-item">MacOS</div></a>
    
    <a href="/tags/Kotlin/" title="Kotlin"><div class="tags-list-item">Kotlin</div></a>
    
    <a href="/tags/Android持久化/" title="Android持久化"><div class="tags-list-item">Android持久化</div></a>
    
    <a href="/tags/CentOS/" title="CentOS"><div class="tags-list-item">CentOS</div></a>
    
    <a href="/tags/Linux/" title="Linux"><div class="tags-list-item">Linux</div></a>
    
    <a href="/tags/Android事件/" title="Android事件"><div class="tags-list-item">Android事件</div></a>
    
    <a href="/tags/Android基础/" title="Android基础"><div class="tags-list-item">Android基础</div></a>
    
    <a href="/tags/Android手势/" title="Android手势"><div class="tags-list-item">Android手势</div></a>
    
    <a href="/tags/Scrcpy/" title="Scrcpy"><div class="tags-list-item">Scrcpy</div></a>
    
    <a href="/tags/Android动画/" title="Android动画"><div class="tags-list-item">Android动画</div></a>
    
    <a href="/tags/Git/" title="Git"><div class="tags-list-item">Git</div></a>
    
    <a href="/tags/Java/" title="Java"><div class="tags-list-item">Java</div></a>
    
    <a href="/tags/Docker/" title="Docker"><div class="tags-list-item">Docker</div></a>
    
    <a href="/tags/Android-Dialog/" title="Android Dialog"><div class="tags-list-item">Android Dialog</div></a>
    
  </div>
</div>
  </article>
  
  
</div>
          </aside>
          <aside class="right-column">
            <div class="sticky-widescreen">
  
  
  <article class="card card-content toc-card">
    <div class="toc-header"><i class="iconfont icon-menu" style="padding-right: 2px;"></i>目录</div>
<ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#1-%E5%9F%BA%E7%A1%80"><span class="toc-text">1.基础</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#2-%E5%B8%B8%E7%94%A8api"><span class="toc-text">2.常用api</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#3-%E5%8E%9F%E7%94%9F%E6%8E%A7%E4%BB%B6%E6%9C%89%E5%85%B3api"><span class="toc-text">3.原生控件有关api</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#4-%E6%8E%A7%E4%BB%B6"><span class="toc-text">4.控件</span></a></li></ol>
  </article>
  
  
  <article class="card card-content">
    <div class="recent-posts-card">
  <div class="recent-posts-header"><i class="iconfont icon-wenzhang_huaban" style="padding-right: 2px;"></i>最近文章</div>
  <div class="recent-posts-list">
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2021-03-02</div>
        <a href="/2021/03/02/Git commit规范/"><div class="recent-posts-item-content">Git commit规范</div></a>
      </div>
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2021-02-16</div>
        <a href="/2021/02/16/AutoJS一文精通AutoJS脚本教程详解/"><div class="recent-posts-item-content">AutoJS一文精通AutoJS脚本教程详解</div></a>
      </div>
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2021-01-21</div>
        <a href="/2021/01/21/架构师进阶：注解Annotation全解/"><div class="recent-posts-item-content">架构师进阶：注解Annotation全解</div></a>
      </div>
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2021-01-06</div>
        <a href="/2021/01/06/ConstraintLayout详解/"><div class="recent-posts-item-content">ConstraintLayout详解</div></a>
      </div>
    
  </div>
</div>
  </article>
  
  
</div>
          </aside>
        </div>
      </div>
    </div>
  </div>
  
  <footer class="footer">
  <div class="footer-container">
    <div>
      <div class="footer-dsc">
        <span>Copyright ©
          
          2020 -
          
          2021
        </span>
        &nbsp;
        <a href="/" class="footer-link">不负明天 </a>
      </div>
    </div>

    
    <div class="footer-dsc">
      
      Powered by
      <a href="https://hexo.io/" class="footer-link" target="_blank" rel="nofollow noopener noreferrer">&nbsp;Hexo </a>
      
      
      <span>&nbsp;|&nbsp;</span>
      
      
      Theme -
      <a href="https://github.com/theme-kaze" class="footer-link" target="_blank"
        rel="nofollow noopener noreferrer">&nbsp;Kaze</a>
      
    </div>
    
    
    
    
      <div class="footer-dsc">
        
        本站总访问量686<span id="busuanzi_value_site_pv"></span>次
        
        
        <span>&nbsp;|&nbsp;</span>
        
        
        本站总访客数219<span id="busuanzi_value_site_uv"></span>次
        
      </div>
      
    
</footer>
  <a role="button" id="scrollbutton" class="basebutton"  aria-label="回到顶部">
  <i class="iconfont icon-arrowleft button-icon"></i>
</a>
<a role="button" id="menubutton" class="basebutton">
  <i class="iconfont icon-menu button-icon"></i>
</a>
<a role="button" id="popbutton" class="basebutton" aria-label="控制中心">
  <i class="iconfont icon-expand button-icon"></i>
</a>
<a role="button" id="darkbutton" class="basebutton darkwidget" aria-label="夜色模式">
  <i class="iconfont icon-weather button-icon"></i>
</a>
<a role="button" id="searchbutton" class="basebutton searchwidget" aria-label="搜索">
  <i class="iconfont icon-search button-icon"></i>
</a>

  
  
  
  <script>
  var addImgLayout = function () {
    var img = document.querySelectorAll('.post-content img');
    var i;
    for (i = 0; i < img.length; i++) {
      var wrapper = document.createElement('a');
      wrapper.setAttribute('href', img[i].getAttribute('data-src'));
      wrapper.setAttribute('aria-label', 'illustration');
      wrapper.style.cssText = 'width: 100%; display: flex; justify-content: center;';
      if (img[i].alt) wrapper.dataset.caption = img[i].alt;
      wrapper.dataset.nolink = true;
      img[i].before(wrapper);
      wrapper.append(img[i]);
      var divWrap = document.createElement('div');
      divWrap.classList.add('gallery');
      wrapper.before(divWrap);
      divWrap.append(wrapper);
    }
    baguetteBox.run('.gallery');
  }
</script>
<script>loadScript("/js/lib/lightbox/baguetteBox.min.js", addImgLayout)</script>
  
  
  
<script src="/js/main.js"></script>

  
  <script>loadScript("/js/lib/busuanzi.min.js")</script>
  
  
  <script>
    var addLazyload = function () {
      var observer = lozad('.lozad', {
        load: function (el) {
          el.srcset = el.getAttribute('data-src');
        },
        loaded: function (el) {
          el.classList.add('loaded');
        }
      });
      observer.observe();
    }
  </script>
  <script>loadScript("/js/lib/lozad.min.js", addLazyload)</script>
  
  
</body>

</html>